
package com.hc.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.hc.dao.IResourcesPicDao;
import com.hc.domain.ResourcesPic;
@Repository
public class ResourcesPicDaoImpl extends BaseDaoImpl<ResourcesPic> implements IResourcesPicDao {

	@Override
	public void saveResource(ResourcesPic resPic) {
		super.save(resPic);
	}

	@Override
	public List<ResourcesPic> findPicsByTypeDesc(String type) {
		String hql = "FROM ResourcesPic r WHERE r.type=? ORDER BY r.sort DESC";
		return super.find(hql, new Object[]{type});
	}

	@Override
	public ResourcesPic getPicById(int resourceId) {
		return super.get("FROM ResourcesPic r WHERE r.resourceId=?", new Object[] {resourceId});
		
	}

	@Override
	public void deletePic(ResourcesPic pic) {
		super.delete(pic);
	}

	@Override
	public void updatePic(ResourcesPic rp) {
		super.update(rp);
	}
}

